package com.mcx.modules.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author mcx
* @date 2022-04-29
**/
@Entity
@Data
@Table(name="log_gamelevel")
public class LogGamelevel implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "编号")
    private Integer id;

    @Column(name = "status",nullable = false)
    @NotNull
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "role_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "角色Id")
    private Integer roleId;

    @Column(name = "game_level_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "游戏关卡Id")
    private Integer gameLevelId;

    @Column(name = "grade")
    @ApiModelProperty(value = "0=普通1=困难2=地狱")
    private Integer grade;

    @Column(name = "action")
    @ApiModelProperty(value = "0=进入关卡1=成功2=失败")
    private Integer action;

    @Column(name = "createtime",nullable = false)
    @NotNull
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createtime;

    public void copy(LogGamelevel source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}